﻿#pragma once
#include <memory>
#include "oatpp/web/server/HttpConnectionHandler.hpp"
#include "oatpp/network/tcp/server/ConnectionProvider.hpp"
#include "oatpp/network/Server.hpp"
#include "HelloHandler.h"
#include "WebFileHandler.h"

class HttpServer
	: std::enable_shared_from_this<HttpServer>
{
public:
	HttpServer();
	virtual ~HttpServer();

public:
	void Start(int port);
	void Stop();

protected:
	void _Work();

protected:
	std::thread m_thread;
	std::shared_ptr<oatpp::network::Server> m_server;
};

typedef std::shared_ptr<HttpServer> HttpServerPtr;